//
//  CZCarCell.m
//  TCProject
//
//  Created by admin on 16/1/29.
//  Copyright © 2016年 wise-wing. All rights reserved.
//

#import "CZCarCell.h"
@interface CZCarCell()

@property (weak, nonatomic) IBOutlet UIView *containerView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

@property (weak, nonatomic) IBOutlet UILabel *chejiaLabel;
@property (weak, nonatomic) IBOutlet UILabel *typeLabel;

@property (weak, nonatomic) IBOutlet UILabel *driverLabel;
@property (weak, nonatomic) IBOutlet UILabel *phoneLabel;
@property (weak, nonatomic) IBOutlet UILabel *carNoLabel;
@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
- (IBAction)operationAction:(id)sender;


@end

@implementation CZCarCell

- (void)awakeFromNib {
    self.containerView.layer.shadowColor = [UIColor grayColor].CGColor;
    self.containerView.layer.shadowOffset = CGSizeMake(0.f, 1.5f);
    self.containerView.layer.shadowRadius = 0.f;
    self.containerView.layer.shadowOpacity = 0.1;

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)operationAction:(UIButton* )sender {
    if (_operation) {
        _operation(sender.tag);
    }

}

- (void)setCar:(CZCar *)car{
    _car = car;
    
    _carNoLabel.text = [NSString stringWithFormat:@"车牌号：%@%@", _car.licensePlate, _car.licensePlateNum];
    _statusLabel.text = _car.statusTitle;
    _nameLabel.text = [NSString stringWithFormat:@"车辆所有人：%@", _car.truckOwner];
    _chejiaLabel.text = [NSString stringWithFormat:@"车架号：%@", _car.frameNum];
    _typeLabel.text = [NSString stringWithFormat:@"车辆类型：%@--%@", _car.style1Name, _car.styleName];
    _driverLabel.text = [NSString stringWithFormat:@"随车司机：%@", _car.driver];
    _phoneLabel.text = [NSString stringWithFormat:@"随车电话：%@", _car.phone];

}
@end
